/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package REABR.impl;

import REA.REAPackage;

import REABR.AssociationPolicy;
import REABR.AttributeValidationPolicy;
import REABR.Operator;
import REABR.ParticipationPolicy;
import REABR.Policy;
import REABR.PolicyModel;
import REABR.REABRFactory;
import REABR.REABRPackage;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class REABRPackageImpl extends EPackageImpl implements REABRPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass policyEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass participationPolicyEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass attributeValidationPolicyEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass associationPolicyEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass policyModelEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum operatorEEnum = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see REABR.REABRPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private REABRPackageImpl() {
		super(eNS_URI, REABRFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link REABRPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static REABRPackage init() {
		if (isInited) return (REABRPackage)EPackage.Registry.INSTANCE.getEPackage(REABRPackage.eNS_URI);

		// Obtain or create and register package
		REABRPackageImpl theREABRPackage = (REABRPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof REABRPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new REABRPackageImpl());

		isInited = true;

		// Initialize simple dependencies
		REAPackage.eINSTANCE.eClass();

		// Create package meta-data objects
		theREABRPackage.createPackageContents();

		// Initialize created meta-data
		theREABRPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theREABRPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(REABRPackage.eNS_URI, theREABRPackage);
		return theREABRPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPolicy() {
		return policyEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPolicy_Name() {
		return (EAttribute)policyEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getPolicy_Container() {
		return (EReference)policyEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getParticipationPolicy() {
		return participationPolicyEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getParticipationPolicy_PolicyEntity() {
		return (EReference)participationPolicyEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getParticipationPolicy_PolicyAttribute() {
		return (EReference)participationPolicyEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getParticipationPolicy_PolicyRelationship() {
		return (EReference)participationPolicyEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getParticipationPolicy_Operator() {
		return (EAttribute)participationPolicyEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getAttributeValidationPolicy() {
		return attributeValidationPolicyEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAttributeValidationPolicy_PolicyAttribute() {
		return (EReference)attributeValidationPolicyEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAttributeValidationPolicy_OperationalAttribute() {
		return (EReference)attributeValidationPolicyEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getAttributeValidationPolicy_Operator() {
		return (EAttribute)attributeValidationPolicyEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAttributeValidationPolicy_PolicyEntity() {
		return (EReference)attributeValidationPolicyEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAttributeValidationPolicy_PolicyRelationship() {
		return (EReference)attributeValidationPolicyEClass.getEStructuralFeatures().get(4);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getAssociationPolicy() {
		return associationPolicyEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAssociationPolicy_PolicyEntities() {
		return (EReference)associationPolicyEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAssociationPolicy_OperationalEntities() {
		return (EReference)associationPolicyEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPolicyModel() {
		return policyModelEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getPolicyModel_Contains() {
		return (EReference)policyModelEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getPolicyModel_Name() {
		return (EAttribute)policyModelEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getOperator() {
		return operatorEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public REABRFactory getREABRFactory() {
		return (REABRFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		policyEClass = createEClass(POLICY);
		createEAttribute(policyEClass, POLICY__NAME);
		createEReference(policyEClass, POLICY__CONTAINER);

		participationPolicyEClass = createEClass(PARTICIPATION_POLICY);
		createEReference(participationPolicyEClass, PARTICIPATION_POLICY__POLICY_ENTITY);
		createEReference(participationPolicyEClass, PARTICIPATION_POLICY__POLICY_ATTRIBUTE);
		createEReference(participationPolicyEClass, PARTICIPATION_POLICY__POLICY_RELATIONSHIP);
		createEAttribute(participationPolicyEClass, PARTICIPATION_POLICY__OPERATOR);

		attributeValidationPolicyEClass = createEClass(ATTRIBUTE_VALIDATION_POLICY);
		createEReference(attributeValidationPolicyEClass, ATTRIBUTE_VALIDATION_POLICY__POLICY_ATTRIBUTE);
		createEReference(attributeValidationPolicyEClass, ATTRIBUTE_VALIDATION_POLICY__OPERATIONAL_ATTRIBUTE);
		createEAttribute(attributeValidationPolicyEClass, ATTRIBUTE_VALIDATION_POLICY__OPERATOR);
		createEReference(attributeValidationPolicyEClass, ATTRIBUTE_VALIDATION_POLICY__POLICY_ENTITY);
		createEReference(attributeValidationPolicyEClass, ATTRIBUTE_VALIDATION_POLICY__POLICY_RELATIONSHIP);

		associationPolicyEClass = createEClass(ASSOCIATION_POLICY);
		createEReference(associationPolicyEClass, ASSOCIATION_POLICY__POLICY_ENTITIES);
		createEReference(associationPolicyEClass, ASSOCIATION_POLICY__OPERATIONAL_ENTITIES);

		policyModelEClass = createEClass(POLICY_MODEL);
		createEReference(policyModelEClass, POLICY_MODEL__CONTAINS);
		createEAttribute(policyModelEClass, POLICY_MODEL__NAME);

		// Create enums
		operatorEEnum = createEEnum(OPERATOR);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		REAPackage theREAPackage = (REAPackage)EPackage.Registry.INSTANCE.getEPackage(REAPackage.eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		participationPolicyEClass.getESuperTypes().add(this.getPolicy());
		attributeValidationPolicyEClass.getESuperTypes().add(this.getPolicy());
		associationPolicyEClass.getESuperTypes().add(this.getPolicy());

		// Initialize classes and features; add operations and parameters
		initEClass(policyEClass, Policy.class, "Policy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getPolicy_Name(), ecorePackage.getEString(), "name", null, 0, 1, Policy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getPolicy_Container(), this.getPolicyModel(), this.getPolicyModel_Contains(), "container", null, 1, 1, Policy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(participationPolicyEClass, ParticipationPolicy.class, "ParticipationPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getParticipationPolicy_PolicyEntity(), theREAPackage.getREAPolicyEntity(), null, "policyEntity", null, 0, 1, ParticipationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getParticipationPolicy_PolicyAttribute(), theREAPackage.getREAAttribute(), null, "policyAttribute", null, 1, 1, ParticipationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getParticipationPolicy_PolicyRelationship(), theREAPackage.getREAPolicyRelation(), null, "policyRelationship", null, 1, 1, ParticipationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getParticipationPolicy_Operator(), this.getOperator(), "operator", null, 0, 1, ParticipationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(attributeValidationPolicyEClass, AttributeValidationPolicy.class, "AttributeValidationPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getAttributeValidationPolicy_PolicyAttribute(), theREAPackage.getREAAttribute(), null, "policyAttribute", null, 0, 1, AttributeValidationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getAttributeValidationPolicy_OperationalAttribute(), theREAPackage.getREAAttribute(), null, "operationalAttribute", null, 0, 1, AttributeValidationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getAttributeValidationPolicy_Operator(), this.getOperator(), "operator", null, 0, 1, AttributeValidationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getAttributeValidationPolicy_PolicyEntity(), theREAPackage.getREAPolicyEntity(), null, "policyEntity", null, 0, 1, AttributeValidationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getAttributeValidationPolicy_PolicyRelationship(), theREAPackage.getREAPolicyRelation(), null, "policyRelationship", null, 0, 1, AttributeValidationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(associationPolicyEClass, AssociationPolicy.class, "AssociationPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getAssociationPolicy_PolicyEntities(), theREAPackage.getREAPolicyEntity(), null, "policyEntities", null, 1, -1, AssociationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getAssociationPolicy_OperationalEntities(), theREAPackage.getREAOperationalEntity(), null, "operationalEntities", null, 0, -1, AssociationPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(policyModelEClass, PolicyModel.class, "PolicyModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getPolicyModel_Contains(), this.getPolicy(), this.getPolicy_Container(), "contains", null, 0, -1, PolicyModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getPolicyModel_Name(), ecorePackage.getEString(), "name", null, 0, 1, PolicyModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Initialize enums and add enum literals
		initEEnum(operatorEEnum, Operator.class, "Operator");
		addEEnumLiteral(operatorEEnum, Operator.EQUALS);
		addEEnumLiteral(operatorEEnum, Operator.LESS_THAN);
		addEEnumLiteral(operatorEEnum, Operator.GREATER_THAN);
		addEEnumLiteral(operatorEEnum, Operator.LESS_OR_EQUALS_THAN);
		addEEnumLiteral(operatorEEnum, Operator.GREATER_OR_EQUALS_THAN);

		// Create resource
		createResource(eNS_URI);
	}

} //REABRPackageImpl
